To measure the ideological content of several major online news services, I compare the topics discussed in these media with the press releases of the Bundestag parties. The following is an analysis of the content of the press releases scraped from the public websites of the political parties and political groups. A big part of this analysis is inspired from the work of Julia Silge and David Robinson (Text Mining with R - A Tidy Approach).

I assume that parties utilize their press releases to promote their issues and positions and thus also contribute to the election campaign. However, it should be noted that there is a difference between the press releases of the parties and the factions. Parties are financed by membership dues, donations and campaign expenses, while factions are financed by state funds. According to Parteigesetzt §25 (2) state funded factions may not support parties from their funds, because otherwise parties that are not in the Bundestag would be practically disadvantaged.

Since it is difficult to draw the line between faction activity and election campaign assistance, I assume that factions intervene in the public perception of this party with their press releases, which is why I include both the press releases of the federal party and the federal faction.

Load Data

CDU

FDP

B90 / Die Grünen

Clean Data

title_text text_cleaned
315 Entlassung Peter Steudtners ist ein Zeichen der Hoffnung Die Entlassung des Menschenrechtlers Peter Steudtner und sieben weiterer Angeklagter aus der Untersuchungshaft ist ein wichtiges Hoffnungszeichen. Die türkische Justiz muss in den kommenden Wochen jedoch beweisen, dass auch für sie die Maximen Rechtsstaatlichkeit und Unabhängigkeit gelten. „Peter Steudtner ist endlich entlassen. Nach Wochen der Sorge und Irritationen ist seine Entlassung und die weiterer Menschenrechtsaktivisten ein Zeichen der Hoffnung. Die Entscheidung des Gerichts ist jedoch nur ein erster Schritt auf einem langen Weg, auf dem die türkische Justiz wieder das Vertrauen der internationalen Öffentlichkeit zurückgewinnen muss. Dafür muss sie auch in den weiteren Wochen und Monaten beweisen, dass Rechtsstaatlichkeit und Unabhängigkeit ihre Maximen sind. Wir dürfen bei dieser erleichternden Nachricht nicht vergessen, dass im vergangenen Jahr weit über 150.000 Menschen wegen des Verdachts der Terrorismusunterstützung in Polizeigewahrsam genommen oder suspendiert wurden. Bis heute warten – unter vielen anderen – zehn Deutsche in türkischen Gefängnissen auf ihre Anklageschrift bzw. ihr Urteil. Den nun aus der Untersuchungshaft entlassenen Angeklagten gilt unser besonderer Respekt für ihre Standfestigkeit und ihren Mut, trotz der systematischen Einschüchterungen für die Menschenrechte zu kämpfen." entlassung peter steudtners zeichen hoffnung entlassung menschenrechtlers peter steudtner angeklagter untersuchungshaft wichtiges hoffnungszeichen türkische justiz kommenden wochen beweisen maximen rechtsstaatlichkeit unabhängigkeit gelten peter steudtner endlich entlassen wochen sorge irritationen entlassung menschenrechtsaktivisten zeichen hoffnung entscheidung gerichts schritt langen türkische justiz vertrauen internationalen öffentlichkeit zurückgewinnen wochen monaten beweisen rechtsstaatlichkeit unabhängigkeit maximen erleichternden nachricht vergessen vergangenen jahr menschen verdachts terrorismusunterstützung polizeigewahrsam suspendiert warten deutsche türkischen gefängnissen anklageschrift urteil untersuchungshaft entlassenen angeklagten besonderer respekt standfestigkeit mut trotz systematischen einschüchterungen menschenrechte kämpfen

Inspect Data

Tokens

tokens <- pressReleases %>% unnest_tokens(word, text_cleaned1)

tokens.count <- tokens %>%
  count(party, word, sort = TRUE) %>%
  ungroup() %>%
  bind_tf_idf(word,party,n)

We can compare the word frequency for the different parties.

Overall, notice in the Figures below that an empty space at low frequency indicates less similarity between two parties. Contrariwise, if words in a two-sided panel are closer to the zero-slope line the two parties use more similar words.

frequency <- tokens.count %>%
  group_by(party) %>%
  mutate(proportion = n/sum(n)) %>%
  select(party, word, proportion) %>%
  spread(party, proportion) 

CDU

SPD

FDP

B90/GRÜNE

DIE LINKE

AfD

TF-IDF

The statistic tf-idf (term frequency - inverse document frequency) is intended to measure how important a word is to a document in a collection (or corpus) of documents. In this case we measure how important a word is to a party (within all the press releases of that party) in the collection of all parties (and their press releases).

The inverse document frequency for any given term is defined as

\[ idf\text{(term)}=\frac{n_{\text{documents}}}{n_{\text{documents containing term}}} \]

In this case, \(n_{\text{documents}} = 6\) as we have 6 different parties.

Terms with low tf-idf:

tokens.count %>%
  arrange(tf_idf) 
## # A tibble: 55,124 x 6
##    party     word                n      tf   idf tf_idf
##    <chr>     <chr>           <int>   <dbl> <dbl>  <dbl>
##  1 DIE LINKE bundesregierung   566 0.0109      0      0
##  2 AfD       deutschland       470 0.0128      0      0
##  3 DIE LINKE deutschland       330 0.00637     0      0
##  4 DIE LINKE eu                324 0.00625     0      0
##  5 DIE LINKE menschen          286 0.00552     0      0
##  6 AfD       deutschen         235 0.00641     0      0
##  7 FDP       deutschland       226 0.0109      0      0
##  8 DIE LINKE endlich           219 0.00423     0      0
##  9 AfD       eu                208 0.00567     0      0
## 10 DIE LINKE vorsitzend        208 0.00401     0      0
## # ... with 55,114 more rows

A 0 idf (and thus tf-idf) indicate, that these terms appear in all six parties press-releases.

The inverse document frequency (and thus tf-idf) is very low (0) for terms that occur in many (all) of the documents (all press releases of one party) in a collection (all press releases of one party);

Terms with high tf-idf.

tokens.count %>%
  arrange(desc(tf_idf))
## # A tibble: 55,124 x 6
##    party     word                  n      tf   idf  tf_idf
##    <chr>     <chr>             <int>   <dbl> <dbl>   <dbl>
##  1 AfD       weidel              185 0.00505  1.79 0.00904
##  2 FDP       beer                 59 0.00286  1.79 0.00512
##  3 FDP       nicola               58 0.00281  1.79 0.00503
##  4 AfD       pazderski            98 0.00267  1.79 0.00479
##  5 AfD       alic                145 0.00395  1.10 0.00434
##  6 FDP       lambsdorff           42 0.00203  1.79 0.00364
##  7 DIE LINKE dagdelen            102 0.00197  1.79 0.00353
##  8 FDP       präsidiumsmitgli     57 0.00276  1.10 0.00303
##  9 AfD       brandner             62 0.00169  1.79 0.00303
## 10 FDP       generalsekretärin    54 0.00261  1.10 0.00287
## # ... with 55,114 more rows

N-Grams

Words can be considered not only as single units, but also as their relationship to each other. N-grams, for example, help to investigate which words tend to follow others immediately. To do this, we tokenize the text into successive sequences of words called n-grams. By seeing how often word X is followed by word Y, we can then build a model of the relationships between them.

Bigrams

bigrams <- pressReleases %>% unnest_tokens(bigram, text_cleaned1, token="ngrams", n=2)

bigrams.count <- bigrams %>%
  count(party, bigram, sort = TRUE) %>%
  ungroup() %>%
  bind_tf_idf(bigram,party,n)

Trigrams